/**
 * Copyright (c) 2012 Axa Holding Belgium, SA. All rights reserved.
 * This software is the confidential and proprietary information of the AXA Group.
 */
package chabernac.android.wordbattle.utils;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipInputStream;

import android.test.InstrumentationTestCase;
import chabernac.wordbattle.test.R;

public class ZipFileIteratorTest extends InstrumentationTestCase {
    public void testZipFileIterator(){
      
      InputStream theInputStream = getInstrumentation().getContext().getResources().openRawResource( R.raw.xx ); 
      ZipFileIterator theZipFileIterator = new ZipFileIterator( new ZipInputStream( theInputStream ), "dic" );

      List<String> theCollectedString = new ArrayList<String>();
      while(theZipFileIterator.hasNext()){
        theCollectedString.add(theZipFileIterator.next());
      }
      
      assertEquals( 2, theCollectedString.size() );
      assertTrue( theCollectedString.contains( "testa" ) );
      assertTrue( theCollectedString.contains( "testb" ) );
    }
}
